package fr.lelouet.server.perf.snapshot.receivers;

import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import fr.lelouet.server.perf.snapshot.ActivityReport;
import fr.lelouet.server.perf.snapshot.HVSnapshot;
import fr.lelouet.server.perf.snapshot.SnapshotReceiver;

/**
 * logs every snapshot to a dedicated slf4j logger.
 * 
 * @author guillaume
 * 
 */
public class LoggerReceiver implements SnapshotReceiver {

	private static final Logger logger = LoggerFactory
			.getLogger(LoggerReceiver.class);

	@Override
	public void configure(Properties prop) {
	}

	@Override
	public void hypervisorModification(HVSnapshot hypervisor, String name) {
		logger.info("received hypervisor {} : {}", new Object[] { name,
				hypervisor });
	}

	@Override
	public void resourceModification(ActivityReport snapshot, String name) {
		logger.info("received activity report {} : {}", new Object[] { name,
				snapshot });
	}

}
